package com.hsmpay.mobile.service.user;

import com.hsmpay.common.service.BaseService;

import java.io.Serializable;
import java.util.Map;

/**
 * 用户交易限制 服务接口 userMoneyService
 *
 * @param <Entity>
 * @param <Query>
 * @author lyc
 *         建立时间：2015-4-21
 */
public interface UserTransLimitService<Entity extends Serializable, Query extends Object> extends BaseService<Entity, Query> {

    /**
     * 余额充值、卡卡转账、信用卡还款等交易校验
     *
     * @param userId
     * @param roleId
     * @param bankCard
     * @param money
     * @param orderTypeId
     * @param functionKey
     * @return
     * @throws Exception
     */
    public Map<String, Object> transCheck(Long userId, Long roleId, String bankCard, Double money, Long orderTypeId, String functionKey, Integer channelId) throws Exception;

    /**
     * 查询用户限制笔数
     */
    public Long getUserLimitNumber(Map<String, Object> userLimitMap, Long roleId, String bankCard) throws Exception;


    /**
     * 查询用户限制金额
     */
    public Double getUserLimitMoney(Map<String, Object> userLimitMap, Long roleId, String bankCard) throws Exception;

    /**
     * 查询用户最低限制
     */
    public Map<String, Object> getUserLeastLimit(Long userId, String functionKey) throws Exception;

    /**
     * 查询单日交易笔数（单日总笔数、单日单卡总笔数）
     *
     * @param userId
     * @return
     * @throws Exception
     */
    public Map<String, Object> numberLimit(Long userId, Long orderTypeId, String bankCard, Map<String, Object> userLimitMap, Long roleId) throws Exception;

    /**
     * 提现笔数限制
     *
     * @param userId
     * @param limitNum
     * @return
     * @throws Exception
     */
    public boolean cashMoneyNumberLimit(Long userId, int limitNum) throws Exception;

    /**
     * 提现总金额限制
     *
     * @param userId            用户ID
     * @param transMoney        交易额
     * @param totalMaxCashMoney 提现最大金额
     * @return
     * @throws Exception
     */
    public boolean cashMoneyTotalMoneyLimit(Long userId, double transMoney, double totalMaxCashMoney) throws Exception;

    /**
     * 查询余额次数限制
     * @param userId
     * @param orderTypeId
     * @param bankCard
     * @return
     * @throws Exception
     */
//    public Map<String, Object> cashinfoqian4sendlogLimit(Long userId, Long orderTypeId, String bankCard)throws Exception;
    public Map<String, Object> userBalanceEnquiryLimit(Long userId, Long orderTypeId, String bankCard)throws Exception;

    /**
     * 秒到业务交易限制
     * @param userId
     * @param roleId
     * @param money
     * @param orderTypeId
     * @param ssTranslimit
     * @return
     */
    public Map<String,Object> ssTransLimit(Long userId, Long roleId, double money, Long orderTypeId, double ssTranslimit) throws Exception;
}